import time
from datetime import datetime

VERSION = 1002
DATE = '%Y-%m-%d'
TIME = '%H:%M:%S'
DATETIME = '%Y-%m-%d %H:%M:%S'


def current_time():
    return time.strftime(TIME)


def current_date():
    return time.strftime(DATE)


def current_datetime():
    return time.strftime(DATETIME)


def mk_time(time_):
    return time.strptime(time_, TIME)


def mk_date(date_):
    return time.strptime(date_, DATE)


def mk_datetime(datetime_):
    return time.strptime(datetime_, DATETIME)


def get_timestamp(datetime_):
    return time.mktime(mk_datetime(datetime_))


def get_time(time_):
    return datetime.strptime(time_, TIME)


def get_date(date_):
    return datetime.strptime(date_, DATE)


def get_datetime(datetime_):
    return datetime.strptime(datetime_, DATETIME)


def get_offset(src_time, base_time):
    src_time = get_time(src_time)
    base_time = get_time(base_time)
    return (src_time - base_time).seconds / 60
